<?php


namespace app\api\controller\v1;


use app\api\service\Pay as PayService;
use app\api\service\WxNotify;
use app\api\validate\IDMustBePositiveInt;

class Pay
{

    protected $middleware = [
        'checkExclusiveScope' => ['only' => 'getPerOrder']
    ];

    public function getPreOrder($id='')
    {
        (new IDMustBePositiveInt())->goCheck();
        $Pay = new PayService($id);
        return $Pay->pay();
    }

    public function receiveNotify($result)
    {
        (new WxNotify())->NotifyProcess($result);
    }
}